// Copyright @ ChenChao

#pragma once

#include "CoreMinimal.h"
#include "GameplayTagContainer.h"
#include "Engine/DataAsset.h"
#include "WarriorDataAssetInputConfig.generated.h"

class UInputAction;
class UInputMappingContext;

//创建U结构体变量：FWarriorInputActionConfig
USTRUCT(BlueprintType)
struct FWarriorInputActionConfig
{
	GENERATED_BODY()

public:
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta=(Categories = "InputTag"))
	FGameplayTag InputTag;	//输入标签

	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
	UInputAction* InputAction = nullptr;	//输入动作
};

/**
 * 
 */
UCLASS()
class WARRIOR_API UWarriorDataAssetInputConfig : public UDataAsset
{
	GENERATED_BODY()

public:
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
	UInputMappingContext* DefaultMappingContext;	//默认输入映射上下文

	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta=(Categories = "InputTag"))
	TArray<FWarriorInputActionConfig> NativeInputActionConfig;	//原始输入动作配置数组

	//通过标签查找输入动作方法
	UInputAction* GetNativeInputActionsByTag(const FGameplayTag& InputTag) const;
	
};
